@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: '메뉴관리 R_MENU'
@Metadata.ignorePropagatedAnnotations: true
define view entity ymoon_r_menu as select from ymoon_i_menu
association to parent ymoon_r_form as _Form on $projection.FormId = _Form.FormId
association of many to one ymoon_r_menu as _Parent on $projection.FormId = _Parent.FormId 
                                                    and $projection.ParentMenu = _Parent.MenuId
association of one to many ymoon_r_menu as _Sub on $projection.FormId = _Sub.FormId 
                                                 and $projection.MenuId = _Sub.ParentMenu
{
    key FormId,
    key MenuId,
    ParentMenu,
    MenuName,
    MenuSeq,
    CreateAt,
    CreateBy,
    ChangedAt,
    ChangedBy,
    LocalLastChangedAt,
    LocalLastChangedBy,
    /* Associations */
    _Form,
    _Parent,
    _Sub
}
